<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>人员档案管理</title>
<link href="<%=request.getContextPath()%>/css/reset.css" rel="stylesheet" type="text/css"/>
<link href="<%=request.getContextPath()%>/css/style.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript">
	function manager(pid){
		var arr = showModalDialog("<%=request.getContextPath()%>/PersionFile.do?method=superviseOrganTree&pid="+pid, "", "dialogWidth:550pt;dialogHeight:400pt;help:0;status:0");
	}
	function area(pid){
		var arr = showModalDialog("<%=request.getContextPath()%>/PersionFile.do?method=functionMenuTree&pid="+pid, "", "dialogWidth:550pt;dialogHeight:400pt;help:0;status:0");
	}
	function selectContacts(rid){
		var arr = showModalDialog("<%=request.getContextPath()%>/PersionFile.do?method=selectUser", "", "dialogWidth:550pt;dialogHeight:400pt;help:0;status:0");
		if(arr != null){
			var sendMessageReceiverId = "";
			for(var i = 0; i < arr.length; i++){
				var arrT = arr[i];
				if(sendMessageReceiverId.indexOf(arrT[0]) < 0){
					sendMessageReceiverId += arrT[0] + ",";
				}
			}
			if(sendMessageReceiverId.length > 0){
			sendMessageReceiverId = sendMessageReceiverId.substr(0, sendMessageReceiverId.length - 1);
			}
			document.form1.uid.value = sendMessageReceiverId;
			document.form1.rid.value = rid;
			if(sendMessageReceiverId != "" && rid != ""){
				document.form1.submit();}
	  	}
    }
</script>
</head>

<body>
<form name="form1" method="post" action="<%=request.getContextPath()%>/RoleInfo.do?method=addUser">
<input type="hidden" name="uid"><input type="hidden" name="rid">
</form>
<table border="0" width="80%">
  <tr>
    <td>角色:${username }</td>
  </tr>
</table>
<table border="1"  width="80%">
  <td colspan="3">
      <input class="buttonshareuser" type="button" value="分配用户" onclick="javascript:selectContacts('<%=session.getAttribute("roleUserRoleId") %>')"></td>
  <tr>
    <th width="130">姓名</th>
	<th width="180">籍贯</th>
    <th width="200">操作</th>
  </tr>
   <c:forEach items="${pList}" var="prod" varStatus="lineInfo">
  <tr <c:if test="${lineInfo.count % 2 == 0}">class="blue"</c:if>>
	<td>${prod.perFileName}</td>
    <td>${prod.perFileNativePlace}</td>
    <td >
    <input type="button"  value="分配机构范围" class="buttonsharepower"
    onclick="javascript:window.location.href='<%=request.getContextPath()%>/PersionFile.do?method=superviseOrganTree&pid=${prod.perFileId }'"/>
    <input type="button"  value="分配地区范围" class="buttonsharepower"
    onclick="javascript:window.location.href='<%=request.getContextPath()%>/PersionFile.do?method=functionMenuTree&pid=${prod.perFileId }'"/>
     <input class="buttondelete" type="button" onclick="if(confirm('确定删除该数据吗？')){window.location.href='<%=request.getContextPath()%>/RoleInfo.do?method=removeUser&pid=${prod.perFileId}'}" value="删除"" />   
      </td>
  </tr>
  </c:forEach>
  <tr>
	    <td class="nohover" colspan="12" align="center">&nbsp;
	    <form name="pageForm" method="post">
	    <c:out value="${foot}" escapeXml="false"/>
	    </form>
	    </td>
    </tr>
  <tr>
    <td class="nohover"colspan="3" align="right">
    <input class="buttonreturn" type="button" value="返回" onClick="javascript:window.location.href='RoleInfo.do?method=list'"></td>
  </tr>
</table>
</body>
</html>
